#include "widget.h"
#include "ui_widget.h"
#include "QPushButton"
#include "QDebug"
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
//    QPushButton* button = new QPushButton(this);
//    button->setText("点击我");
//    button->setEnabled(false);
    ui->pushButton->setEnabled(false);

    //
    connect(ui->pushButton_control,&QPushButton::clicked,this,&Widget::handle);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::handle()
{
    if(ui->pushButton->isEnabled())
        ui->pushButton->setEnabled(false);
    else
        ui->pushButton->setEnabled(true);
}


void Widget::on_pushButton_clicked()
{
    qDebug()<< "pushButton 被点击";
}
